package io.lvdaxian.mybatis06.datasource.pooled;


import io.lvdaxian.mybatis06.datasource.unpooled.UnpooledDataSourceFactory;

import javax.sql.DataSource;

public class PooledDataSourceFactory extends UnpooledDataSourceFactory {
  @Override
  public DataSource getDataSource() {
    PooledDataSource pooledDataSource = new PooledDataSource();
    
    pooledDataSource.setDriver(properties.getProperty("driver"));
    pooledDataSource.setUsername(properties.getProperty("username"));
    pooledDataSource.setPassword(properties.getProperty("password"));
    pooledDataSource.setUrl(properties.getProperty("url"));
    
    return pooledDataSource;
  }
}
